/*
* @Author: lyq
* @Date:   2018-08-03 15:24:03
* @Last Modified by:   lyq
* @Last Modified time: 2018-08-03 15:24:03
*
* 小程序配置文件
*/

import * as config_local from './config_local'

var host = ""  //服务器地址
if (config_local.host) {
  host = config_local.host
}

var config = {
  //appid
  appid: "wx8f9032e368a4388a",
  appName: "和之初",
  productName: '和之初',
  //接口地址
  host,  
  /**
   * 登录授权
   */
  //用code换区openID
  openIdUrl: `${host}/dmz/discountMall/wxLogin.json`,
  /**
   * 优惠商城相关接口
   */
  //优惠商城搜索接口
  getSearchData: `${host}/dmz/pmall/goods/query.json`,
  //优惠商城banner图片接口
  getHomeBanner: `${host}/dmz/discountMall/imgBanner.json`,
  //优惠商城导航今日主推列表数据
  getHomeFirstData: `${host}/dmz/discountMall/homePage.json`,
  //优惠商城商品详情接口
  goodsInfo: `${host}/dmz/discountMall/goodsDetail.json`,
  //优惠商城加入购物车接口
  addCouponsGoods: `${host}/dmz/discountMall/addCartStatus.json`,
  //提交订单，上传地址ID,跳转到支付页面
  commitOrderBefore: `${host}/dmz/discountMall/commitOrderBefore.json`,  
  //优惠商城购物车页面数据接口
  CouponsCarGoods: `${host}/dmz/discountMall/addCart.json`,
  //优惠商城提交订单，结算
  // commitOrder: `${host}/dmz/discountMall/commitOrder.json`,
  //收货地址
  myAddr: `${host}/dmz/discountMall/address.json`,
  //删除收货地址
  deleteAddr: `${host}/dmz/discountMall/rmAddress.json`,
  //保存收货地址
  saveAddr: `${host}/dmz/discountMall/saveAddress.json`,
  //修改收货地址
  modiAddr: `${host}/dmz/discountMall/updateAddress.json`,

  /**
   * 特惠商城相关接口
   */
  //特惠首次加载数据商城
  getPowerFirstData: `${host}/privilegedMall/dmz/mobile/index.json`,
  //特惠商城搜索接口
  powerSearchData: `${host}/privilegedMall/dmz/mobile/goodsQuery.json`,
  //特权商城商品详情接口
  powerGoodsInfo: `${host}/privilegedMall/dmz/mobile/goodsDetail.json`,
  //特权商城加入购物车接口
  addPowerGoods: `${host}/privilegedMall/dmz/cart/put.json`,
  request: {
    duration: 2000
  },
  toastDuration: 3000
};

for (var key in config_local.default) {
  config[key] = config_local.default[key]
}

module.exports = config